package com.tierstall.client.event;

import com.google.gwt.event.shared.GwtEvent;
import com.tierstall.client.view.main.ContentWidget;
import com.tierstall.shared.Page;

public class GoToPageEvent extends GwtEvent<GoToPageEventHandler> {
  public static Type<GoToPageEventHandler> TYPE = new Type<GoToPageEventHandler>();
  public final Page page;
  public Object o = null;
  
//  public GoToPageEvent(ContentWidget page){
//	  this.view = page;
//	  this.page = view.getPagename();
//  }
  public GoToPageEvent(Page page){
	  this.page = page;
  }
  
  public Page getPage(){
	  return page;
  }
  
  public void setData(Object o){
	  this.o = o;
  }
  
  public Object getData(){
	  return o;
  }
  
  @Override
  public Type<GoToPageEventHandler> getAssociatedType() {
    return TYPE;
  }

  @Override
  protected void dispatch(GoToPageEventHandler handler) {
    handler.onGoToPageAction(this);
  }
}
